#!/bin/bash

check_ip() {
    local ip="$1"
   
    ping -c 3 -W 1 "$ip" > /dev/null 2>&1
   
    if [ $? -eq 0 ]; then
        echo "success"
    else
        echo "fail"
    fi
}
check_ip "$1"
